<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    //判断闰年：能被400整除，或者能被4整除但不能被100整除
    //取两个值之间的最大值
    let flage1=2000,flage2=1949;
    console.log((flage1%400==0)||(flage1%4==0&&flage1%100!=0));
    console.log((flage2%400==0)||(flage2%4==0&&flage2%100!=0));
    //判断最大值
    let shuzhi1=+prompt('请输入一个数字'),shuzhi2=+prompt('请再输入一个数字');
    shuzhi1>shuzhi2?alert(`最大数为${shuzhi1}`):alert(`最大数为${shuzhi2}`);
    //三元运算符
    let x=prompt('请输入第一个数'),y=prompt('请输入第二个数');
    let result=x>y?x:y;
    console.log(result);
    alert(`最大数为${result}`);

    console.log('------------------');
    let year=prompt('请输入一个年份');
    let isR =(year%400===0)||(year%4===0&&year%100!=0)?`${year}闰年`:`${year}平年`;
    console.log(isR);
    alert(`该年为${isR}`);
</script>
</html>